package com.alibaba.shop.provider.controller;


import com.alibaba.shop.common.vo.R;
import com.alibaba.shop.provider.service.intf.OssLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/provider/oss/")
public class OssLogController {
    @Autowired
    private OssLogService service;

    //文件上传
    @PostMapping("/imgupload.do")
    public R uploadImg(MultipartFile file) throws IOException {
        return service.uploadImg(file);
    }
    //查询全部
    @GetMapping("/all.do")
    public R all(){
        return service.all();
    }
}
